package com.chengqj;

import com.chengqj.dao.UserDO;
import com.chengqj.repository.UserRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

/**
 * Copyright © 2021年 tx-demo. All rights reserved.
 *
 * @author chengqj
 * TODO: 为了共建和谐社会，请为该类写点注释吧...
 * version 1.0.0 (接口必须带上)
 * @date 2021/4/13 17:43
 */
@Service
public class UserServiceTowService {
    @Autowired
private UserRepository userRepository;

    /**
     * 添加一条记录
     *
     * @param userDO
     * @return
     */
    @Transactional
    public UserDO insert(UserDO userDO) {
        userRepository.save(userDO);
        throw new RuntimeException();
    }
}
